﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ReversiBackend
{
    public abstract class Player
    {
        protected Game game;
        protected int playerIndex;

        public abstract string Name { get; }

        public Player(Game game, int playerIndex)
        {
            this.game = game;
            this.playerIndex = playerIndex;
        }

        public abstract void YourTurn();
        public abstract void Die();

    }

    public abstract class AI : Player
    {
        private TimerFunc timerFunc;
        public AI(Game g, int playerIndex, TimerFunc f)
            : base(g, playerIndex)
        {
            timerFunc = f;
        }

        public override void YourTurn()
        {
            // do next move after a (short?) delay (to allow gui to refresh and the user to see whats going on)
            timerFunc(DoNextMove);
        }

        /// <summary>
        /// Do the next move.
        /// </summary>
        public abstract void DoNextMove();
    }
}
